package com.newland.starpos.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.newland.starpos.base.exception.CustomException;
import com.newland.starpos.http.ResponseModel;
import com.newland.starpos.partner.service.AuthCodeService;
import com.newland.starpos.utils.StringUtils;

@Controller
@RequestMapping(value = "/authcode")
public class AuthCodeController {
	
	@Autowired
	private AuthCodeService authCodeService;
	
	public ResponseModel sendAuthCode(String phoneNumber) throws CustomException {
		
		StringUtils.checkPhoneNumber(phoneNumber);
		
		return authCodeService.sendAuthCode(phoneNumber);
	}

}
